this.BX=this.BX||{};(function(t,e,n,i,a){"use strict";var l=function(){function t(){babelHelpers.classCallCheck(this,t)}babelHelpers.createClass(t,[{key:"getContent",value:function t(){return e.Tag.render("<div></div>")}},{key:"getButtonCollection",value:function t(){return[]}},{key:"init",value:function t(e){}}]);return t}();var o;var s=function(t){babelHelpers.inherits(i,t);function i(){babelHelpers.classCallCheck(this,i);return babelHelpers.possibleConstructorReturn(this,babelHelpers.getPrototypeOf(i).apply(this,arguments))}babelHelpers.createClass(i,[{key:"getContent",value:function t(){return e.Tag.render(o||(o=babelHelpers.taggedTemplateLiteral(['\n\t\t\t<div>\n\t\t\t\t<center>\n\t\t\t\t<h1>\u0410\u043a\u0442\u0438\u0432\u043e\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043b\u044e\u0447</h1>\n\t\t\t\t<h5>\u042d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0441 \u043f\u0440\u0430\u0432\u0430\u043c\u0438 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430</h5>\n\t\t\t\t</center>\n\t\t\t\t<form id="intranet-license-activate-key-form" name="testForm">\n\t\t\t\t<div class="ui-form">\n\t\t\t\t\t<div class="ui-form-row">\n\t\t\t\t\t  <div class="ui-form-label">\n\t\t\t\t\t   <div class="ui-ctl-label-text">\u041b\u043e\u0433\u0438\u043d \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430</div>\n\t\t\t\t\t  </div>\n\t\t\t\t\t  <div class="ui-form-content">\n\t\t\t\t\t   <div class="ui-ctl ui-ctl-textbox ui-ctl-w100">\n\t\t\t\t\t    <input type="text" name="login" class="ui-ctl-element" placeholder="Admin">\n\t\t\t\t\t   </div>\n\t\t\t\t\t  </div>\n\t\t\t\t\t </div>\n\t\t\t\t\t <div class="ui-form-row">\n\t\t\t\t\t  <div class="ui-form-label">\n\t\t\t\t\t   <div class="ui-ctl-label-text">\u041f\u0430\u0440\u043e\u043b\u044c</div>\n\t\t\t\t\t  </div>\n\t\t\t\t\t  <div class="ui-form-content">\n\t\t\t\t\t   <div class="ui-ctl ui-ctl-textbox ui-ctl-w100">\n\t\t\t\t\t    <input type="password" name="password" class="ui-ctl-element" placeholder="**********">\n\t\t\t\t\t   </div>\n\t\t\t\t\t  </div>\n\t\t\t\t\t </div>\n\t\t\t\t\t\n\t\t\t\t\t<div class="ui-form-row">\n\t\t\t\t\t  <div class="ui-form-label">\n\t\t\t\t\t   <div class="ui-ctl-label-text">\u041b\u0438\u0447\u0435\u043d\u0437\u0438\u043e\u043d\u043d\u044b\u0439 \u043a\u043b\u044e\u0447 \u0438\u043b\u0438 \u043a\u0443\u043f\u043e\u043d</div>\n\t\t\t\t\t  </div>\n\t\t\t\t\t  <div class="ui-form-content">\n\t\t\t\t\t   <div class="ui-ctl ui-ctl-textbox ui-ctl-w100">\n\t\t\t\t\t    <input type="text" name="key" class="ui-ctl-element" placeholder="XXXX-XXXX-XXXX-XXXX-XX">\n\t\t\t\t\t   </div>\n\t\t\t\t\t  </div>\n\t\t\t\t\t </div>\n\t\t\t\t\t</div>\n\t\t\t\t</form>\n\t\t\t</div>\n'])))}},{key:"getButtonCollection",value:function t(){var i=this;var l=new n.Button({text:"",noCaps:true,round:true,className:"license-popup-back-btn",icon:BX.UI.Button.Icon.BACK,color:BX.UI.Button.Color.LIGHT_BORDER,size:BX.UI.Button.Size.MEDIUM,tag:BX.UI.Button.Tag.BUTTON,onclick:function t(){a.EventEmitter.emit(a.EventEmitter.GLOBAL_TARGET,"MainCouponActivation:back",{source:i})}});var o=new n.Button({text:e.Loc.getMessage("INTRANET_LICENSE_POPUP_BUTTON_ACTIVATE"),noCaps:false,round:true,size:BX.UI.Button.Size.MEDIUM,color:BX.UI.Button.Color.SUCCESS,tag:BX.UI.Button.Tag.BUTTON,onclick:function t(){var e;console.log("do request");var n=document.querySelector("#intranet-license-activate-key-form");var i=new FormData(n);(e=console).log.apply(e,babelHelpers.toConsumableArray(i))}});var s=new n.Button({text:e.Loc.getMessage("INTRANET_LICENSE_POPUP_BUTTON_NEED_HELP"),noCaps:true,round:true,className:"license-popup-link-btn",link:"https://dev.1c-bitrix.ru/learning/course/index.php?COURSE_ID=135&LESSON_ID=25720",size:BX.UI.Button.Size.EXTRA_SMALL,color:BX.UI.Button.Color.LINK,tag:BX.UI.Button.Tag.LINK,onclick:function t(){console.log("do request")}});return[l,o,s]}},{key:"init",value:function t(e){e.setContent(this.getContent());e.setButtons(this.getButtonCollection())}},{key:"request",value:function t(n){e.ajax.runComponentAction("bitrix:intranet.license.popup","activate",{mode:"class",data:n}).then((function(t){console.log(t)}),(function(t){console.error(t)}))}}]);return i}(l);var r;var c=function(t){babelHelpers.inherits(i,t);function i(){babelHelpers.classCallCheck(this,i);return babelHelpers.possibleConstructorReturn(this,babelHelpers.getPrototypeOf(i).apply(this,arguments))}babelHelpers.createClass(i,[{key:"getContent",value:function t(){return e.Tag.render(r||(r=babelHelpers.taggedTemplateLiteral(['\n\t\t\t<div style="margin: 13px; height: 85%; background-color: #dbf2f9;">\n\t\t\t\t<center>\n\t\t\t\t\t<h1>\u0414\u043e\u0441\u0442\u0443\u043f \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0437\u0430\u043a\u0440\u044b\u0442</h1>\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\u0421\u0440\u043e\u043a \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043b\u0438\u0446\u0443\u043d\u0437\u0438\u0438 \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u043b\u0441\u044f, \u0434\u043b\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0432\u0430\u043c \u043d\u0435\u0436\u043d\u043e \u043f\u0440\u043e\u0434\u043b\u0438\u0442\u044c \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0443. \n\t\t\t\t\t\t\u041d\u0435 \u0432\u043e\u043b\u043d\u0443\u0439\u0442\u0435\u0441\u044c, \u0432\u0441\u0435 \u0432\u0430\u0448\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0441\u043e\u0437\u0440\u0430\u043d\u0438\u043b\u0438\u0441\u044c. \n\t\t\t\t\t\t\u041f\u043e\u0441\u043b\u0435 \u043f\u043e\u043a\u0443\u043f\u043a\u0438 \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043b\u044e\u0447 \u043f\u0440\u043e\u0434\u043b\u0435\u043d\u0438\u044f \u0441\u043c\u043e\u0436\u0435\u0442 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440 \u0432\u0430\u0448\u0435\u0433\u043e \u0411\u0438\u0442\u0440\u0438\u043a\u044124\n\t\t\t\t\t\t</p>\n\t\t\t\t\t</div>\n\t\t\t\t</center>\n\t\t\t</div>\n'])))}},{key:"getButtonCollection",value:function t(){var i=this;var l=new n.Button({text:e.Loc.getMessage("INTRANET_LICENSE_POPUP_BUTTON_RENEW"),noCaps:false,round:true,link:"https://www.1c-bitrix.ru/personal/order/basket.php",size:BX.UI.Button.Size.MEDIUM,color:BX.UI.Button.Color.SUCCESS,tag:BX.UI.Button.Tag.LINK});var o=new n.Button({text:e.Loc.getMessage("INTRANET_LICENSE_POPUP_BUTTON_ACTIVATE_KEY"),noCaps:false,round:true,size:BX.UI.Button.Size.MEDIUM,color:BX.UI.Button.Color.PRIMARY,tag:BX.UI.Button.Tag.BUTTON,onclick:function t(){console.log("event activate");a.EventEmitter.emit(a.EventEmitter.GLOBAL_TARGET,"MainCouponActivation:changeContent",{source:i,target:new s})}});return[l,o]}},{key:"init",value:function t(e){e.setContent(this.getContent());e.setButtons(this.getButtonCollection())}}]);return i}(l);function u(t,e,n){v(t,e);e.set(t,n)}function v(t,e){if(e.has(t)){throw new TypeError("Cannot initialize the same private elements twice on an object")}}var p=new WeakMap;var d=new WeakMap;var b=new WeakMap;var h=function(){function t(){babelHelpers.classCallCheck(this,t);u(this,p,{writable:true,value:void 0});u(this,d,{writable:true,value:void 0});u(this,b,{writable:true,value:void 0});babelHelpers.classPrivateFieldSet(this,b,[]);babelHelpers.classPrivateFieldSet(this,d,new c);a.EventEmitter.subscribe(a.EventEmitter.GLOBAL_TARGET,"MainCouponActivation:changeContent",this.changeHandler.bind(this));a.EventEmitter.subscribe(a.EventEmitter.GLOBAL_TARGET,"MainCouponActivation:back",this.backHandler.bind(this))}babelHelpers.createClass(t,[{key:"getPopup",value:function t(){if(babelHelpers.classPrivateFieldGet(this,p)){return babelHelpers.classPrivateFieldGet(this,p)}babelHelpers.classPrivateFieldSet(this,p,new i.Popup({width:808,height:535,closeIcon:true}));return babelHelpers.classPrivateFieldGet(this,p)}},{key:"addHistory",value:function t(e){babelHelpers.classPrivateFieldGet(this,b).push(e)}},{key:"back",value:function t(){var e=babelHelpers.classPrivateFieldGet(this,b).pop();if(e instanceof l){babelHelpers.classPrivateFieldSet(this,d,e)}}},{key:"init",value:function t(){this.changeContent();this.getPopup().show()}},{key:"changeContent",value:function t(){babelHelpers.classPrivateFieldGet(this,d).init(this.getPopup())}},{key:"changeHandler",value:function t(e){if(e.data.target instanceof l){this.addHistory(babelHelpers.classPrivateFieldGet(this,d));babelHelpers.classPrivateFieldSet(this,d,e.data.target)}this.changeContent()}},{key:"backHandler",value:function t(e){if(e.data.source instanceof l){this.back()}this.changeContent()}}]);return t}();console.log("======== ......... >");t.LicensePopup=h})(this.BX.Intranet=this.BX.Intranet||{},BX,BX.UI,BX.Main,BX.Event);
//# sourceMappingURL=script.map.js